package com.rjxy.plansystemmanagement.service.impl;

import com.rjxy.plansystemmanagement.entity.AirlinerInformation;
import com.rjxy.plansystemmanagement.mapper.AirlinerMapper;
import com.rjxy.plansystemmanagement.service.AirlinerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AirlinerServiceImpl implements AirlinerService {
    @Autowired
    private AirlinerMapper airlinerMapper;

    /**
     * 查询所有客机
     * @return
     */
    @Override
    public List<AirlinerInformation> list() {
        return airlinerMapper.list();
    }

    /**
     * 根据id删除客机
     * @param id
     */
    @Override
    public void deleteAirliner(Integer id) {
        airlinerMapper.deleteAirliner(id);
    }

    /**
     * 增加客机
     * @param airlinerInformation
     */
    @Override
    public void addAirliner(AirlinerInformation airlinerInformation) {
        airlinerMapper.addAirliner(airlinerInformation);
    }

    /**
     * 根据id查询指定客机
     * @param id
     * @return
     */
    @Override
    public AirlinerInformation getAirlinerById(Integer id) {
        return airlinerMapper.getAirlinerById(id);
    }

    /**
     * 更新id的客机
     * @param airlinerInformation
     */
    @Override
    public void updateAirliner(AirlinerInformation airlinerInformation) {
        airlinerMapper.updateAirliner(airlinerInformation);
    }
}
